
package phase1.part1;

import static org.junit.Assert.assertEquals;

import java.util.HashMap;
import java.util.Map;

import org.junit.Test;

import phase1.part1.RecursiveDescender.Result;

/**
 * 
 * 
 * @author John Girata
 * @version Nov 17, 2012
 */
public class RecursiveDescenderTest {
	@Test
	public void testProcess() {
		Map<String, CharacterClass> map = new HashMap<>();
		map.put("DIGIT", new CharacterClass('0', '9'));
		
		RecursiveDescender rd = new RecursiveDescender(map);
		assertEquals(Result.NEW_REGEX, rd.processRegex("$NUMBER ($DIGIT)*"));
		
		rd.getLastNFA().print(System.out);
	}
}
